from django.shortcuts import render, reverse
from django.http import HttpResponseRedirect

# Create your views here.
def load_student_info(request):
    if not request.user.is_authenticated:
        return HttpResponseRedirect(reverse('survey_login'))
    
    _id = request.user.student_id
    name = request.user.student_name
    student_class = request.user.student_class
    college = request.user.college
    major = request.user.major
    
    return render(request, "students/student_info.html",
                  context={
                      "id": _id,
                      "name": name,
                      "student_class": student_class,
                      "college": college,
                      "major": major
                  })